package org.example.controller;



import lombok.extern.slf4j.Slf4j;
import org.example.pojo.Mushroom;
import org.example.pojo.MapData;
import org.example.pojo.Result;
import org.example.pojo.ScatterData;
import org.example.service.MushroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/category")
@Slf4j
@CrossOrigin(origins = "http://localhost:5173")
public class MushroomController {


    @Autowired
    MushroomService categoryServicel;


    @GetMapping("/list1/{type}")
    public Result <List<Mushroom>> list(@PathVariable String type) {
        return Result.success(categoryServicel.selectCategoryList(type));
    }



    @GetMapping("/list2/{type}")
    public Result <List<ScatterData>> list2(@PathVariable String type) {
        return Result.success(categoryServicel.selectScatterDataList(type));
    }

    @GetMapping("/list3")
    public Result <List<MapData>> list3() {
        return Result.success(categoryServicel.MapDataList());
    }





}
